#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>

int main()
{
    umask(0);
    int fd = open("bite",O_WRONLY|O_CREAT,0666);
    if(fd == -1)
    {
        perror("open");
        exit(-1);
    }
    char ch[20]= "i like linux!\n";
    write(fd,ch,sizeof(ch));
    close(fd);

    int fdd = open("bite",O_RDONLY);
    char ret[20];
    read(fd,ret,sizeof(ret));
    printf("%s\n",ret);
    close(fdd);
    return 0;
}

